import request from '@/utils/request'

enum API{
    C1 = '/admin/product/getCategory1',
    C2 = '/admin/product/getCategory2/',
    C3 = '/admin/product/getCategory3/',
    ATTR = '/admin/product/attrInfoList/',
    ATTRVALUE = '/admin/product/saveAttrInfo',
    DELETEATTR = '/admin/product/deleteAttr/'
}

export const reqC1List = () => request.get(API.C1)
export const reqC2List = (category1Id:number|string) =>request.get(API.C2 + category1Id)
export const reqC3List = (category2Id:number|string) =>request.get(API.C3 + category2Id)
export const reqAttrList = (category1Id:number|string,category2Id:number|string,category3Id:number|string)=>request.get(API.ATTR + `${category1Id}/${category2Id}/${category3Id}`)

// 获取添加|修改属性值的接口,携带请求体参数
export const reqAttrValueList = (data)=>request.post(API.ATTRVALUE,data)

// 删除平台属性的接口
export const reqDeleteAttr = (attrId:number)=>request.delete(API.DELETEATTR+attrId)